<div class="topic-header">
	<a href="community.php?topic=<?php echo($topicID); ?>">
		<h3>	
			<span class="label label-primary"> <span class="glyphicon glyphicon-list-alt"></span>&nbsp<?php echo($currentTopic["name"]); ?> </span>
		</h3>
	</a>
</div>

<div>
	<?php
		if(isset($postCreatedSuccess) && $postCreatedSuccess)
		{
			include("./templates/PostCreationSuccess.php");
		}
	?>
</div>

<?php
	$newPostTopicID = $topicID;
	if(isset($defaultPosts))
	{
		foreach ($defaultPosts as $i => $value) 
		{	
			$renderPost = $value;
			include("./templates/DefaultTopic.php");
		}
	}
?>

<div class="new-post-container">
	<div class="panel panel-primary">
		<div class="panel-heading">New Post</div>
		<div class="panel-body">
			<form method="POST" role="form" action="community.php" id="new-post-form" name="newpost">
				<input type="hidden" name="txtNewPostTopicID" class="span4 form-control input-sm" id="txtNewPostTopicID" placeholder="Name" maxlength="45" value="<?php if(isset($newPostTopicID) && !empty($newPostTopicID)){echo $newPostTopicID;} ?>"/>
				<div>
					<div class="form-group">
						<label for="txtNewPostTitle">Title</label>
						<div class="input-group input-group-sm">
							<span class="input-group-addon">
								<i class="glyphicon glyphicon-list-alt"></i>
							</span>	
							<input type="text" name="txtNewPostTitle" class="span4 form-control input-sm" id="txtNewPostTitle" placeholder="Title" maxlength="45" value="<?php if(isset($newTopicTitle) && !empty($newPostTitle)){echo $newTopicTitle;} ?>"/>
						</div>
					</div>
				</div>
				
				<div>
					<div class="form-group">
						<label for="txtNewPostBody">Message</label>
						<div class="input-group input-group-sm">
							<span class="input-group-addon">
								<i class="glyphicon"></i>
							</span>	
							<textarea rows="10" cols="75" class="form-control input-sm span6" name="txtNewPostBody" id="txtNewPostBody" size="300" placeholder="What is this post about?"><?php if(isset($newTopicBody) && !empty($newTopicBody)){echo $newTopicBody;} ?></textarea>
						</div>
					</div>
				</div>
				
				<div class="form-group">
					<div>
						<label for="btnCreatePost" class="btn btn-primary "><i class="glyphicon glyphicon-envelope"></i> Post</label>
						<input type="submit" class="btn btn-primary hidden" id="btnCreatePost" name="btnCreatePost" value="Post">
					</div>
				</div>
				
				<div>
					<?php
						//form status message
					?>
				</div>
			</form>	
		</div>
	</div>
</div>